﻿using Furion;
using MongoDB.Driver;
using MongoDB.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace furion.blog.Utils
{
    /// <summary>
    /// Mongo操作类(基于MongoDB.Entities)
    /// </summary>
    public class MongoUtil
    {
        private static string DataBaseName = null;
        private static string CONNECT_STR = null;

        static MongoUtil() {
            DataBaseName = App.Configuration["Mongo:DB"];
            CONNECT_STR = App.Configuration["Mongo:Connection"];
        }

        public static async Task InitDB() { 
           await DB.InitAsync(DataBaseName, MongoClientSettings.FromConnectionString(CONNECT_STR));
        }

    }
}
